<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=0.5,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no, email=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <!-- 删除苹果默认的工具栏和菜单栏 -->
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <!-- 设置苹果工具栏颜色 -->
    <meta name="format-detection" content="telphone=no, email=no" />
    <!-- 忽略页面中的数字识别为电话，忽略email识别 -->
    <!-- 启用360浏览器的极速模式(webkit) -->
    <meta name="renderer" content="webkit">
    <!-- 避免IE使用兼容模式 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 针对手持设备优化，主要是针对一些老的不识别viewport的浏览器，比如黑莓 -->
    <meta name="HandheldFriendly" content="true">
    <!-- 微软的老式浏览器 -->
    <meta name="MobileOptimized" content="320">
    <!-- uc强制竖屏 -->
    <meta name="screen-orientation" content="portrait">
    <!-- QQ强制竖屏 -->
    <meta name="x5-orientation" content="portrait">
    <!-- UC强制全屏 -->
    <meta name="full-screen" content="yes">
    <!-- QQ强制全屏 -->
    <meta name="x5-fullscreen" content="true">
    <!-- UC应用模式 -->
    <meta name="browsermode" content="application">
    <!-- QQ应用模式 -->
    <meta name="x5-page-mode" content="app">
    <!-- windows phone 点击无高光 -->
    <meta name="msapplication-tap-highlight" content="no">
    <title>虾客云-客户管理</title>
    <link rel="stylesheet" href="{{asset('css/reset.css')}}">
    <link rel="stylesheet" href="{{asset('css/main.css')}}">
    <link rel="stylesheet" href="{{asset('css/index.css')}}">
    <link rel="stylesheet" href="{{asset('css/yd_rl.css')}}" />
    <link rel="stylesheet" href="{{asset('css/LCalendar.css')}}" />
</head>
<body>
    <!-- 公共头部 -->
    <div class="g2_head-bg">
        <!-- 返回上一层 -->
        <p class="g2_head_goback-bg fl">
            <a href="index.html">
                <img src="{{asset('images/xky_icon0-1.png')}}" class="g2_head_goback_icon fl" alt="">
                <span class="g2_head_goback_del fl">返回</span>
            </a>
        </p>
        <p class="ym-tit fl">回访调查</p>
        <span class="g2_head_goback_del fr khtj_sx ykghlb_sx" style="display:block;">筛选</span>
        <div class="cl"></div>
    </div>
    <div class="g2_head-bg2"></div>
    <!-- 回访调查  客户列表 -->
    <ul class="hfdx_khlb-bg" id="ykghlb1">
        <div id="kaikuo">
            @foreach($diaocha as $vo)
            <li class="hfdx_khlb">
                <span class="hfdx_khname fl">{{$vo->customer_id}}</span>
                <span class="hfdx_khdate fl">{{$vo->date}}</span>
                <span class="hfdx_khcylx fl">{{$vo->type}}</span>
                <span class="hfdx_khcyd2 fr">{{$vo->didian}}</span>
                <div class="cl"></div>
            </li>
            @endforeach
        </div>
        <!-- 加载更多按钮 -->
        <div class="jzmore-bg" style="margin-bottom:22vw;" id="jiazai">
            <img src="{{asset('images/jiazai.png')}}" alt="">
            <span>加载更多</span>
        </div>
        <a href="{{url('xiadan')}}">
            <input type="button" class="gdlb_xd-btn" value="下单">
        </a>
    </ul>

    <!-- 回访调查客户列表 筛选条件 -->
    <div class="khlb_sx-bg" id="ykghlb2">
        <form action="" id="huifangform">
            <input type="hidden" name="shuliang" id="shuliang" value="{{$shuliang}}">
            <ul class="khs2">
                <li class="khs2_list">
                    <p class="khs2_tit fl">客户姓名</p>
                    <input type="text" name="customer_id" class="khs2_del fl" placeholder="请填写客户姓名" value="">
                    <div class="cl"></div>
                </li>
                <li class="khs2_list">
                    <p class="khs2_tit fl">旅游日期</p>
                    <p class="khs2_del fl" style="position:relative;">
                        <input type="text" name="date" id="start_date" placeholder="请选择旅游日期" readonly="readonly" style="border:1px solid #999;border-radius:4px;width:50%;left:0;top:20px;height:50px;text-align:center;"
                            />
                    </p>
                    <div class="cl"></div>
                </li>
                <li class="khs2_list">
                    <p class="khs2_tit fl">旅游类型</p>
                    <span class="sewv fl" style="width:48%;">
                        <span class="sewvtop">
                            <input type="text" name="type" id="lvyouleixing" class="khs2_del fl" placeholder="请选择旅游类型" value="">
                            <em>
                                <img src="{{asset('images/xky_icon9.png')}}">
                            </em>
                        </span>
                        <ul class="sewvbm">
                            @foreach($type as $vo)
                            <li>{{$vo->title}}</li>
                            @endforeach
                        </ul>
                    </span>
                    <div class="cl"></div>
                </li>
                <li class="khs2_list">
                    <p class="khs2_tit fl">旅游地点</p>
                    <span class="sewv fl" style="width:48%;">
                        <span class="sewvtop">
                            <input type="text" name="didian" id="didian" class="khs2_del fl" placeholder="请选择旅游地点" value="">
                            <em>
                                <img src="{{asset('images/xky_icon9.png')}}">
                            </em>
                        </span>
                        <ul class="sewvbm" id="lvyoudidian">
                        </ul>
                    </span>
                    <div class="cl"></div>
                </li>
                <input type="sibmit" id="sousuo" class="gdsx_search-btn" value="搜索">
            </ul>
        </form>
    </div>

    <script src="{{asset('js/jquery.min.js')}}"></script>
    <script src="{{asset('js/fastclick.min.js')}}"></script>
</body>
    <script src="{{asset('js/LCalendar.js')}}" type="text/javascript" charset="utf-8"></script>
    <script src="{{asset('js/index.js')}}" type="text/javascript" charset="utf-8"></script>
    <script>
    $(function () {
        FastClick.attach(document.body);
    });
    $(function(){  
        $("#didian").click(function(){
            var lvyouleixing=$("#lvyouleixing").val();
            $.ajax({
                url:"{{url('lvyouleixing')}}",
                type:'get', //GET
                async:false,    //或false,是否异步
                data:{'lvyouleixing':lvyouleixing},
                dataType:'json',    //返回的数据格式：json/xml/html/script/jsonp/text
                success:function(data){ 
                    var html="<li>请选择旅游地点<\/li>";
                    $.each(data,function(i,item){
                        html+="<li>"+item+"</li>";
                　　});
                    $("#lvyoudidian").html(html);
                    $("#lvyoudidian li").click(function(){
                        $("#didian").val($(this).html());
                        $("#lvyoudidian").css('display','none');
                    })
                }, 
            })
        }); 
    })
    // 执行回访调查筛选查询
    $(function () {
        $("#sousuo").click(function(){
            var d = {};
            var t = $('#huifangform').serializeArray();
            $.each(t, function() {
              d[this.name] = this.value;
            });
            var data=JSON.stringify(d);
            // alert(data);
            $.ajax({
                url:"{{url('huifangsousuo')}}",
                type:'post', //GET
                async:false,    //或false,是否异步
                data:{'_token':'{{csrf_token()}}','data':data},
                dataType:'json',    //返回的数据格式：json/xml/html/script/jsonp/text
                beforeSend:function(){
                    console.log('发送前');
                    $('.z2_loading-bg').show();
                },
                success:function(data){
                    if(data=="false"){
                        $('.z2_loading-bg').hide();
                        $("#tishi").html('搜索失败');
                        $("#tishi").stop(true, true).fadeIn('fast');
                        $("#tishi").fadeOut(1500);
                        window.location.href = "{{url('/')}}";
                    }else{
                        var html="";
                        $.each(data.diaocha,function(i,item){
                            html+="<li class=\"hfdx_khlb\"><span class=\"hfdx_khname fl\">"+item.customer_id+"<\/span><span class=\"hfdx_khdate fl\">"+item.date+"<\/span><span class=\"hfdx_khcylx fl\">"+item.type+"<\/span><span class=\"hfdx_khcyd2 fr\">"+item.didian+"<\/span><div class=\"cl\"><\/div><\/li>";
                    　　});
                        $("#kaikuo").html(html);
                        $("#shuliang").val(data.shuliang);
                    }
                }, 
                complete:function(){
                    location.hash = 'khlb1';
                    $("#khlb1").show();
                    $("#khlb2").hide();
                    $("#khlb3").hide();
                    $("#khlb4").hide();
                    $("#khlb5").hide();
                    $('.z2_loading-bg').hide();
                    $('.duihao').show();
                    $('.duihao').hide(1000);
                }
            })
        });  
    });
    $("#jiazai").click(function(){
            var shu=$("#shuliang").val();
            $("#shuliang").val(shu*1+10);
            var d = {};
            var t = $('#formid').serializeArray();
            $.each(t, function() {
              d[this.name] = this.value;
            });
            var data=JSON.stringify(d);
            $.ajax({
                url:"{{url('order/chaxun')}}",
                type:'post', //GET
                async:false,    //或false,是否异步
                data:{'_token':'{{csrf_token()}}','data':data},
                dataType:'json',    //返回的数据格式：json/xml/html/script/jsonp/text
                beforeSend:function(){
                    console.log('发送前');
                    $('.z2_loading-bg').show();
                },
                success:function(data){
                    var html="";
                    if(data=="false"){
                        location.reload(); 
                    }else{
                        $.each(data.order,function(i,item){
                            html+="<li class=\"gdlb_list gdlb_cjd\"><a href=\"jjj\"><p class=\"gdlb_tite\"><span class=\"gdlb_username fl\">"+item.customer+"<\/span><span class=\"gd_cjhs fr\">"+item.tai+"<\/span><span class=\"gd_cjzt fr\">"+item.dan+"<\/span><div class=\"cl\"><\/div><\/p><p class=\"gdlb_lylx\">"+item.type+"<\/p><p class=\"gdlb_xq\"><span class=\"gblb_xq1 fl\"><span>录入时间:<\/span><span class=\"gdlb_date\">"+item.order_orderdate+"<\/span><span class=\"gdlb_place\"> (<span>"+item.didian+"<\/span>)<\/span></span> <span class=\"gdlb_bq fr\">"+item.biaoqian+"<\/span><div class=\"cl\"><\/div><\/p><\/a><\/li>";
                    　　});
                        $("#shuliang").val(data.shuliang);
                        $("#orderlist").html(html);
                    }
                }, 
                complete:function(){
                    // window.location.reload();//刷新頁面
                    location.hash = 'gdgl1';
                    $("#gdgl1").show();
                    $("#gdgl2").hide();
                    $('.ym-tit').html('工单列表');
                    $('.z2_loading-bg').hide();
                    $('.duihao').show();
                    $('.duihao').hide(1000);
                }
            })
    })
    window.onload = function (event) {
        location.hash = 'ykghlb1';
        $("#ykghlb1").show();
        $("#ykghlb2").hide();
    }
    $(window).on('hashchange', function (e) {
        var id = location.hash.substr(1);
        $("#" + id).show()

        if (id == "ykghlb1") {
            $("#ykghlb1").show();
            $("#ykghlb2").hide();
            $('.ykghlb_sx').show();
            $('.ym-tit').html('回访调查');
        } else if (id == "ykghlb2") {
            $("#ykghlb1").hide();
            $("#ykghlb2").show();
            $('.ykghlb_sx').hide();
            $('.ym-tit').html('游客列表筛选');
        }
    })
    // 客户列表点击出现筛选
    $('.khtj_sx').click(function () {
        location.hash = 'ykghlb2';
        $("#ykghlb1").hide();
        $("#ykghlb2").show();
        $('.ykghlb_sx').hide();
        $('.ym-tit').html('游客列表筛选');
    })
    
    </script>
    <script type="text/javascript">
        var calendar = new LCalendar();
        calendar.init({
            'trigger': '#start_date', //标签id
            'type': 'date', //date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择,
            'minDate': (new Date().getFullYear() - 3) + '-' + 1 + '-' + 1, //最小日期
            'maxDate': (new Date().getFullYear() + 3) + '-' + 12 + '-' + 31 //最大日期
        });

        var calendar = new LCalendar();
        calendar.init({
            'trigger': '#end_date', //标签id
            'type': 'date', //date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择,
            'minDate': (new Date().getFullYear() - 3) + '-' + 1 + '-' + 1, //最小日期
            'maxDate': (new Date().getFullYear() + 3) + '-' + 12 + '-' + 31 //最大日期
        });
        // $('.date_btn').click(function () {
        //     alert(111);
        //     $('.grzx_xgdate').css('display', 'block');
        // })

    </script>
</html>